home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / demos / 275 / pascal / getpixel.doc < prev    next >
Encoding:
Text File  |  1988-07-14  |  3.0 KB  |  76 lines

  1.  
  2.                                 Get_Pixel_Value
  3.  
  4.  
  5.               This is a Procedure for Personal Pascal that allows you
  6.          to check the value of a given Pixel.  Even though the code is
  7.          Personal Pascal, it shouldn't be too hard to convert it to
  8.          other languages.
  9.  
  10.  
  11.               Included in this archive are :
  12.  
  13.  
  14.              GETPIXEL.DOC  -  This file
  15.              GETPIXEL.PAS  -  The subroutine - Use as an Include file
  16.              TEST.PAS      -  Source code for example program
  17.              TEST.PRG      -  Compiled version of example program
  18.  
  19.               To use GETPIXEL, The call is as follows:
  20.  
  21.  
  22.              Get_Pixel_Value( X,Y, PixelValue, ColorIndex ) ;
  23.  
  24.               Here X and Y are the X and Y coordinates of the pixel
  25.          you want to check. PixelValue and ColorIndex are return
  26.          values giving you the state of the pixel. Both of these refer
  27.          to the color of the pixel. All four of these parameters are
  28.          Short_Integer Values. If you are using Personal Pascal
  29.          version one, just change 'Short_Integer' to 'Integer' and the
  30.          procedure will work just fine - also I suggest that you
  31.          upgrade to version 2 if you plan to keep using Personal
  32.          Pascal as there are many extensions that you will not be able
  33.          to use otherwise.
  34.  
  35.          Following are Color Index and Pixel Value tables for the 2
  36.          color resolutions - I haven't used it for monochrome so I
  37.          can't tell you what they are however I'm sure that the
  38.          subroutine should work in a monochrome program. The colors
  39.          mentioned are the default colors in the pallette.
  40.  
  41.          Low resolution
  42.  
  43.          Color Index   Color     Pixel Value
  44.          -----------------------------------
  45.              0         White          0
  46.              1         Black          15
  47.              2         Red            1
  48.              3         Green          2
  49.              4         Blue           4
  50.              5         Cyan           6
  51.              6         Yellow         3
  52.              7         Magenta        5
  53.              8         Low White      7
  54.              9         Grey           8
  55.              10        Light Red      9
  56.              11        Light Green    10
  57.              12        Light Blue     12
  58.              13        Light Cyan     14
  59.              14        Light Yellow   11
  60.              15        Light Magenta  13
  61.  
  62.          Medium Resolution
  63.  
  64.          Color Index   Color     Pixel Value
  65.          -----------------------------------
  66.              0         White          0
  67.              1         Black          3
  68.              2         Red            1
  69.              3         Green          2
  70.  
  71.  
  72.               If you have any questions I can be reached through my
  73.          GEnie mail address, J.S.GALLARDO, or in the main message area
  74.          on the Iowa Student Computer Association BBS, 319-335-3331
  75.          300-2400 baud, as Jose Gallardo.
  76.